package edu.jd.movieplatform.c_admin.feedback;

import edu.jd.movieplatform.common.MTokenUtils;
import edu.jd.movieplatform.common.Result;
import org.springframework.web.bind.annotation.*;
import edu.jd.movieplatform.common.*;
import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/c_admin/feedback")
public class FeedBackAPI {
    @Resource
    private FeedBackService feedBackService;

    @Resource
    private CommonService commonService;
    @GetMapping("")
    public Result getFeedbackList(FeedBackDto dto){
        Map<String,Object> page = feedBackService.getFeedbackList(dto);
        return Result.success(page);
    }

    @PostMapping("")
    public Result replyComment(@RequestBody ReplyDto dto,@RequestHeader("Token")String token){
        dto.setM_id(MTokenUtils.getUserInfo(token,commonService).getM_id());
        feedBackService.replyComment(dto);
        return Result.success("更新成功!!");
    }

}
